home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / ARMLINUX / MAIL / 9804 / 000082_9606585c@udcf.gla.ac.uk _Mon Apr 20 10:57:49 1998.msg < prev    next >
Internet Message Format  |  1998-05-13  |  6KB

  1. Return-Path: <9606585c@udcf.gla.ac.uk>
  2. Received: from lenzie.cent.gla.ac.uk (lenzie.cent.gla.ac.uk [130.209.16.18])
  3.     by odie.barnet.ac.uk (8.8.6/8.8.6) with ESMTP id KAA14984
  4.     for <willy@odie.barnet.ac.uk>; Mon, 20 Apr 1998 10:57:48 +0100
  5. Received: from localhost (9606585c@localhost)
  6.     by lenzie.cent.gla.ac.uk (8.8.4/8.8.8) with SMTP id KAA03216;
  7.     Mon, 20 Apr 1998 10:57:39 +0100 (BST)
  8. Date: Mon, 20 Apr 1998 10:57:37 +0100 (BST)
  9. From: James Craig <9606585c@udcf.gla.ac.uk>
  10. X-Sender: 9606585c@lenzie.cent.gla.ac.uk
  11. Reply-To: James Craig <9606585c@udcf.gla.ac.uk>
  12. To: Russell King - ARM Linux Admin <linux@arm.uk.linux.org>
  13. cc: James Craig <root@mad.scientist.com>, willy@odie.barnet.ac.uk,
  14.         ajb85@cam.ac.uk, linux-arm@vger.rutgers.edu
  15. Subject: Re: fd0* device for ADFS shape discs under i386 Linux
  16. In-Reply-To: <199804191046.LAA01114@raistlin.armlinux.org>
  17. Message-ID: <Pine.GSO.3.95.980420104916.16862C-100000@lenzie.cent.gla.ac.uk>
  18. MIME-Version: 1.0
  19. Content-Type: TEXT/PLAIN; charset=US-ASCII
  20. Status: RO
  21.  
  22. On Sun, 19 Apr 1998, Russell King - ARM Linux Admin wrote:
  23.  
  24. > James Craig writes:
  25. > > On Fri, 17 Apr 1998, Matthew Wilcox wrote:
  26. > > >Andrew Bower
  27. > > >> Out of interest, is anyone working on write support for ADFS?
  28. > > >
  29. > > >I've looked at the current code.  It would be hard to add extendable
  30. > > >files to it, though in principle, files which are newly created and stay
  31. > > >the same length should be able to work quite easily.
  32. > > >
  33. > > >The trouble is that ADFS (or more truthfully filecore) does not have
  34. > > >the concept of the inode.  Inodes are what Unix filesystems are built of.
  35. > > >They have the following properties:
  36. > > >
  37. > > >Each file has an inode
  38. > > >The inode remains the same during the life of the file
  39. > > >Inodes do not map to more than one file.
  40. > > >The inode contains all of the metadata for the file except its name.
  41. > >
  42. > > umm. ADFS doesn't have inodes in the same way UNIX does, but couldn't you
  43. > > get away with the file's ID that appears in the free space map? (He said,
  44. > > trying to talk knowledgably, despite the fact that it's 5 years since he
  45. > > last wrote an ADFS-E-format-filing-system-reader).
  46. > I did toy with that idea, after all,  it is quite unique.  However, you stumble
  47. > on a small problem:
  48. > Under Unix, a filename translates to an inode.  An inode then gives you the
  49. > file data, and attributes.
  50. > Under Filecore, a filename translates to a fragment ID + attributes.  A
  51. > fragment ID translates to file data.
  52. > Hence, if you do use the fragment ID for the inode number, then yes, you can
  53. > access the file's data, but you can't get the inodes attributes, since you
  54. > don't know where these are stored on the disk.
  55. > I did at one point use a combination of the fragment ID for the parent directory
  56. > and the fragment ID of the file, but 32-bits isn't enough to store this and
  57. > the sector offset required.
  58. > This method still isn't acceptable for a writable ADFS - if the file is moved from
  59. > the directory to another, then it's parent ID changes...
  60. Yeah, I can quite definately see the problem. However, could we store a
  61. hash table of recently-accessed-inodes and just cache their directory
  62. info? It's not like you can't search and ADFS filesystem for a particular
  63. ID, it just takes a while. For small enough numbers of files, (say a
  64. floppy) you could do it at mount/umount time.
  65.  
  66. > > The IDs still only map to one file, aren't likely to change over it's
  67. > > lifetime, and the only problem you have is that the length info is kept in
  68. > > the directory info.
  69. > Exactly.
  70. > > >Create a structure in memory for each ADFS filesystem mounted.  This can
  71. > > >be done lazily.  Assign each file an inode based on some scheme which will
  72. > > >allow for easy mapping between it and the name of the ADFS file.  Perhaps
  73. > > >hash buckets.  Note that it's okay to reuse inodes once a file has been
  74. > > >deleted.
  75. > >
  76. > > Ur, YUK!! That would be horrible. I mean, mapping names to inodes is gonna
  77. > > break as soon as you move a mile about the FS somewhere.
  78. > I think that this is horrible, but may be the only way.
  79. How would it handle mv /bin/testfile /tmp/testfile, though, if the file
  80. was still being read by another process?
  81.  
  82. > > >Someone should look at other filing systems to see how they cope with
  83. > > >filesystems that don't provide nice inodes.  When Dickon Hood & I were
  84. > > >experimenting with NFS servers under RISC OS, we had a structure that
  85. > > >worked well; it was a tree, and the inode we returned was the address
  86. > > >within that list.  You've got me intrigued now, I might just do it.
  87. > >
  88. > > Good man, writable ADFS would be nice. :)
  89. > >
  90. > > >The way Russell has done it is faster than this method for read-only
  91. > > >but will not extend to writable files.
  92. > >
  93. > > I haven't looked at it yet, but what's he done that stops you writing
  94. > > files the same way?
  95. > The problem is that the inode number depends on the position of the directory
  96. > on the disk and the offset into the directory.  If you add a file, then
  97. > as far as the Linux VFS is concerned, all the inodes on that disk have changed,
  98. > and all inodes must be refreshed.  NFS will go mad (since it depends on inodes
  99. > staying the same), as will things like `pwd'.
  100. > Linux needs to be able to map an inode number directly to a file on ADFS -
  101. > this is the first problem that someone's going to have to crack when allowing
  102. > ADFS to be writable.
  103.  
  104. Truly. I've written ADFS file readers and writers before, but I've never
  105. tried integrating one into a totally different OS's idea of a filing
  106. system. In the meantime, we could probably fairly quickly code up an ADFS
  107. equivalent of the mtools for DOS - The old IscaFS that Phil Norman wrote
  108. would do the job just fine if we could manage to fiddle it to run under
  109. Linux. :)
  110. -- James Craig
  111.    <jcraig@mad.scientist.com>
  112.  
  113.